
#include <sdk/misc.h>
#include "gtest/gtest.h"
#include "UI_Logic_API.h"
#include "UI_Logic_Interface.h"
using namespace std;

TEST(GameLoop, UI_API){
    /*init();

    loadAI("Ai/libtestExecuter.dll", 1);

    pushInfo("{\"action\":\"changemode\",\"params\":[\"mirror\",\"../test/game/mirror_files/0_1.json\"]}", 1);

    char * result = new char[12000];

    sendCommand("[{\"name\":\"UseSkill\",\"params\":[\"_Entity_Actor_Plant_BasePlant_2\",\"PlainAttack\",\"_Entity_Actor_Plant_BasePlant_1\"]}]");
    invokeAI();
    run();
    getReplay(result);
    puts(result);

    delete[] result;*/
}


TEST(GameLoop, HumanAI0){
    /*srand(2);
    init();
    loadAI("Ai/libHumanAI0.dll", 1);
    loadAI("Ai/libHumanAI0.dll", 2);
    FILE* fout = fopen("HumanAI0.txt", "w");
    char * result = new char[1200000];
    for (unsigned i = 0; i < 10; ++ i){
        cout << "Round " << i << endl;
        invokeAI();
        getPlayerCommand(result, 1);
        fprintf(fout, "%s\n", result);
        getPlayerCommand(result, 2);
        fprintf(fout, "%s\n", result);
        run();
        getReplayOneturn(result);
        fprintf(fout, "%s\n", result);
    }
    delete[] result;
    UI_Logic_Interface::getInstance()->logicExecutor->game->dumpReplay("HumanAI");
    //cout << "ok" << endl;*/
}